﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MixScriptWeb.control;

namespace MixScriptWeb.Jideco.MM
{
    public partial class SOInq : cCommonWeb2
    {
        private static DateTime tglPO;
        protected void Page_Load(object sender, EventArgs e)
        {
            {
                if (!Page.IsPostBack)
                {
                    addFindClickAttribute(this, new MixScriptTB[] { txtCuid }, new string[] { "SRCSUPGJ" });
                    txtDate1.CssClass += " ritonli";
                    //string[] sheadertext = new string[] { "date", "PO No", "Customer", "ID Customer"};
                    //string[] sdatavalue = new string[] { "podt", "pono", "bpidnm", "codfbpid" };                    
                    //  initGvColumn(gvdetail, sheadertext, sdatavalue, new int[] { 0}, "{0:dd-MM-yyyy}");

                }
              //  mn = (MainMenu)this.Master;
                //hideStatusBar();
            }    
        }
       
        protected void btnClear_Click(object sender, EventArgs e)
        {
            //txtGRN.Text = "";
        }

        protected void btnPrint_Click(object sender, EventArgs e)
        {

            string tgl1="";
            string tgl2="";
            
            if (txtDate1.Text != string.Empty)
                tgl1 = toMDY(txtDate1.Text);


            if (txtDate2.Text != string.Empty)
                tgl2 = toMDY(txtDate2.Text);

             
            
            string sscript = "";
            sscript += "<script>";

            sscript += "window.open('../print/rptid-14,so-" + txtPONum.Text + ",cus-" + txtCuid.Text + ",t1-" + tgl1.Replace("-", "@") + ",t2-" + tgl2.Replace("-", "@") + ",dl.html', '_blank');";
            //sscript += "window.open('../print/rptid-13,m-" + txtPONum.Text + ",w-" + txtCuid.Text + ",b-" + tgl1 + ",t-" + tgl2 + ",dl.html', '_blank');";
            sscript += "</script>";
            ClientScript.RegisterStartupScript(GetType(), "report", sscript);     
        }
    }
}